#include "Precompiled.hpp"
#include "Player.hpp"

Player::Player(void):mp_offset_(0x264), mp_max_offset_(0x280),
                     hp_offset_(0x260), hp_max_offset_(0x27c),
                     level_offset_(0x254), monster_id_offset_(0x97c)
{
    int* add1 = reinterpret_cast<int*>(0xac176c);
    int* add2 = reinterpret_cast<int*>((*add1) + 0x28);
    player_info_addr_ = *add2;
}
Player::~Player(void)
{
}

int Player::getMp()
{
    return getField(mp_offset_); 
}
int Player::getMpMax()
{
    return getField(mp_max_offset_);
}

int Player::getHp()
{
    return getField(hp_offset_);
}
int Player::getHpMax()
{
    return getField(hp_max_offset_);
}
int Player::getLevel()
{
    return getField(level_offset_);
}

int Player::getField(int offset)
{
    return *reinterpret_cast<int*>(player_info_addr_ + offset);
}

int Player::getMonsterId()
{
    return getField(monster_id_offset_);
}
